package com.baizhi.cmfz.appcontroller;

import com.baizhi.cmfz.entity.Album;
import com.baizhi.cmfz.service.AlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * This is a Class.
 *
 * @author zhanglh
 * @date 2019/09/23
 */
@RestController
@RequestMapping("album")
public class AlbumController {
    @Autowired
    private AlbumService albumService;

    @GetMapping("findAlbumList/{count}")
    public List<Album> findAlbumList(@PathVariable int count) {
        return albumService.findAlbumList(count);
    }

    @GetMapping("findAlbumById/{albumId}")
    public Album findAlbumById(@PathVariable int albumId) {
        return albumService.findAlbumById(albumId);
    }
}
